package com.tuniu.agents.message;

import org.springframework.ai.chat.model.ToolContext;

import java.util.List;

/**
 * Tool Logger
 */
public interface ToolLogger {

    /**
     * Called before processing the request.
     *
     * @param request the request object
     * @param context the tool context
     * @return a list of log messages
     */
    List<String> before(Object request, ToolContext context);

    /**
     * Called after processing the request.
     *
     * @param request the request object
     * @param context the tool context
     * @param response the response object
     * @return a list of log messages
     */
    List<String> after(Object request, ToolContext context, Object response);

    /**
     * Handles exceptions during tool invocation.
     *
     * @param request the session ID
     * @param context the user message
     * @param throwable the exception
     * @return an empty list as the result
     */
    default List<String> throwable(Object request, ToolContext context, Throwable throwable) {
        return List.of();
    }

}
